package cate.game.event.pointrace;

import cate.game.event.GameEventListener;
import cate.game.pvp.pointrace.handler.PointRaceHandler;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@SuppressWarnings("unused")
public class PointRaceTimerEventListener implements GameEventListener<PointRaceTimerEvent> {

    @Override
    public void onEvent(PointRaceTimerEvent timerEvent) {
        log.debug("收到了事件 {}", timerEvent);
        PointRaceHandler handler = timerEvent.getGameBody().pvp.pointRace.getLocalHandler();
        switch (timerEvent.getEventType()) {
            case OPEN:
                handler.onOpenEvent(timerEvent.getOpenEvent());
                break;
            case DAY_SPAN:
                handler.onDaySpanEvent(timerEvent.getDaySpanEvent());
                break;
            case SWITCH:
                handler.onSwitchEvent(timerEvent.getSwitchEvent());
                break;
            case CLOSE:
                handler.onClosedEvent(timerEvent.getClosedEvent());
                break;
            case RANK_DAY_RWD:
                handler.onRankDayRwdEvent(timerEvent.getRankDayRwdEvent());
                break;
            case RANK_SEASON_RWD:
                handler.onRankSeasonDayRwdEvent(timerEvent.getRankSeasonRwdEvent());
                break;
            default:
                break;
        }
    }
}
